<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/16 0016
 * Time: 下午 11:22
 */

namespace app\dlc\controller;
use think\Db;

class CasesController extends CommonController
{
    public function index()
    {
        $this->headBotton('','add','添加','/dlc/'.$this->className.'/_edit');
        $this->headSearch('','name','名称','1');
        $this->listBotton('','edit','编辑','/dlc/'.$this->className.'/_edit');
        $this->listBotton('','history','查看方案明细','/dlc/CaseItem/index');
        $this->listBotton('','del','删除','/Dlc/'.$this->className.'/_del','1','确定删除');
        $this->loading('index');
        $this->search('name',1);
        $map = $this->map;
        $data = model($this->className)->where($map)->order('id desc')->page(self::$page)->select();
        $count = Db::name($this->className)->where($map)->count();
        $this->getPage($count, self::$psize, 'App-loader', $this->title, 'App-search');
        $this->assign('data',$data);
        $list = ['id'=>'ID','website|name'=>'所属网站','name'=>'方案名称','name'=>'方案名称','url'=>'采集的url','ctime'=>'创建时间','sys'=>'操作'];
        $this->assign('list',$list);
        echo $this->fetch('common/index');
    }
    

}